package echat.future.cn.echat.my.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import echat.future.cn.echat.R;
import echat.future.cn.echat.my.bean.ReachrgeListBean;
import echat.future.cn.echat.my.utils.ImageLoadUtils;

/**
 * 贡献值适配器
 */
public class ContributionAdapter extends BaseQuickAdapter<ReachrgeListBean,BaseViewHolder> {

    public ContributionAdapter(@Nullable List<ReachrgeListBean> data) {
        super(R.layout.item_contribution,data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ReachrgeListBean item) {
        helper.setText(R.id.name,item.getUsername())
                .setText(R.id.time,new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(item.getCreate_time()*1000)))
                .setText(R.id.contribution,item.getMoney());
        ImageLoadUtils.loadImage(mContext,item.getAvatar(),helper.getView(R.id.head));
    }
}
